--群功能菜单
return function (group,qq,msg,id,bl)
    
    --所有需要运行的app
    local app =   {

        {--今日运势
            check = function()
                return msg == "今日运势" or msg == "明日运势" or msg == "昨日运势"
            end,
            run = function()
                local getAlmanac = require("app.common.almanac")
                sendMessage(cqCode_At(qq) .. getAlmanac(qq))
                return true
            end,
            explain = function()
                return "运势"
            end
        },
        {--查快递
            check = function()
                return msg:find("查快递") == 1
            end,
            run = function()
                local express = require("app.common.express.express")
                local m = express(msg,qq)
                sendMessage(m)
                return true
            end,
            explain = function()
                return "查快递"
            end
        },
        {--快递选择
            check = function()
                return msg:find("快递选择") == 1
            end,
            run = function()
    
                local expresschoose = require("app.express.expresschoose")
                local m = expresschoose(msg,qq)
                sendMessage(m)
                return true
            end,
        },
        {--点歌
            check = function()
                return msg:find("点歌") == 1 or msg:find("来首") == 1
            end,
            run = function()
                local qqmusic = require("app.common.qqmusic")
                sendMessage(qqmusic(msg))
                return true
            end,
            explain = function()
                return "点歌"
            end
        },
        {--b站av号解析
            check = function()
                return msg:find("av") == 1
            end,
            run = function()
                local av = require("app.common.av")
                sendMessage(av(msg))
                return true
            end,
            explain = function()
                return "b站av号解析"
            end
        },
        {--抽奖
            check = function()
                return msg == "抽奖" 
            end,
            run = function()
                local banplay = require("app.common.luck")
                sendMessage(banplay(msg, qq, group))
                return true
            end,
            explain = function()
                return "抽奖"
            end
        },
        {--禁言卡
            check = function()
                return  msg:find("禁言卡") == 1 or msg:find("禁言解除") == 1
            end,
            run = function()
                local banplay = require("app.common.bancard")
                sendMessage(banplay(msg, qq, group))
                return true
            end,
            explain = function()
                return "禁言卡"
            end
        },
        {--签到
            check = function()
                return msg == "签到" or msg:find("%[CQ:rich,") == 1
            end,
            run = function()
                local sign = require("app.common.sign")
                sendMessage(sign(qq, group))
                return true
            end,
            explain = function()
                return "签到"
            end
        },
        {--必应美图
            check = function()
                return msg:find("必应") == 1 and (message:find("美图") or message:find("壁纸"))
            end,
            run = function()
                local bing = require("app.common.bing")
                sendMessage(bing())
                return true
            end,
            explain = function()
                return "必应壁纸"
            end
        },
        {--一言
            check = function()
                return msg == "一言"
            end,
            run = function()
                local hitokoto = require("app.common.hitokoto")
                sendMessage(hitokoto())
                return true
            end,
            explain = function()
                return "一言"
            end
        },
        {--二维码生成
            check = function()
                return msg:find("二维码生成")==1
            end,
            run = function()
                local key = msg:gsub("二维码生成","")
                if apiQREncode(key) < 0 then
                    sendMessage("数据过长")
                    return true
                end
                sendMessage(cqCqCode_Image("qr.jpg"))
                return true
            end,
            explain = function()
                return "二维码生成"
            end
        },
        {--短故事
            check = function()
                return msg:find("故事")==1
            end,
            run = function()
                local story = require("app.common.tianxinapi.story")
                sendMessage(story())
                return true
            end,
            explain = function()
                return "故事"
            end
        },
        {--二维码logo生成
            check = function()
                return msg:find("二维码logo生成")==1
            end,
            run = function()
                local key = msg:gsub("二维码logo生成","")
                apiCombinImage("qr.jpg","logo.png")
                sendMessage(cqCqCode_Image("add.jpg"))
                return true
            end,
            explain = function()
                return "二维码logo生成"
            end
        },
        {--手机端图片延迟输入
            check = function()
                return msg:find("%[CQ:image,file=")==1
            end,
            run = function()
                if tonumber(apiXmlGet("","qrocr",tostring(qq))) == 0 then 
                    local QRocr = require("app.common.QRocr")
                    sendMessage(QRocr(qq,msg))
                end
                return true
            end,
        },
        {--点赞
            check = function()
                return msg:find("赞我")
            end,
            run = function()
                local day = os.date("%Y年%m月%d日")--今天
                local last = apiXmlGet("", "Praise",tostring(qq))
                if last == day then
                    sendMessage(cqCode_At(qq).."今天已经给你点过赞啦")
                    return true
                end
                cqSendPraise(qq,10)
                apiXmlSet("", "Praise",tostring(qq),day)
                sendMessage(cqCode_At(qq).."给你点10个赞！")
                return true
            end,
            explain = function()
                return "赞我"
            end
        },
        {--二维码解码
            check = function()
                return msg:find("二维码解码")==1
            end,
            run = function()
                local QRocr = require("app.common.QRocr")
                sendMessage(QRocr(qq,msg))
                return true
            end,
            explain = function()
                return "二维码解码"
            end
        },
        {--翻译
            check = function()
                return msg:find("翻译")==1
            end,
            run = function()
                local translate = require("app.common.baidu.translate")
                sendMessage(translate(msg))
                return true
            end,
            explain = function()
                return "翻译"
            end
        },
        {--成语接龙
            check = function()
                return msg:find("？")==1 or msg:find("成语接龙帮助")==1 
            end,
            run = function()
                local idiom = require("app.common.idiom")
                sendMessage(idiom(group,msg))
                return true
            end,
            explain = function()
                return "成语接龙"
            end
        },
        {--打劫
            check = function()
                return msg:find("%[CQ:at,qq=") and msg:find("打劫")
            end,
            run = function()
                local rob = require("app.common.assets.robbery")
                sendMessage(rob(group,qq,msg))
                return true
            end,
            explain = function()
                return "打劫"
            end
        },
        {--资产查询
            check = function()
                return msg == "资产查询"
            end,
            run = function()
                local assets = apiXmlGet(tostring(group), "assets",tostring(qq))
                if assets == "" then
                    assets = "500"
                    apiXmlSet(tostring(group),"assets",tostring(qq),tostring(assets))
                end
                
                local getassets = require("app.common.assets.conversion")
                assets = getassets(tonumber(assets))
                sendMessage(cqCode_At(qq) .."你当前资产为:\n"..assets)
                return true
            end,
            explain = function()
                return "资产查询"
            end
        }, 
        {--腾讯短链接
            check = function()
                return msg:find("短链接") == 1
            end,
            run = function()
                local keys = msg:gsub("短链接","")
                keys = kickSpace(keys):encodeURI()
                local surl = apiHttpGet("https://sa.sogou.com/gettiny?url="..keys)
                if surl == nil then
                    sendMessage("请输入正确的网址")
                    return true
                end
                sendMessage(surl)
            end,
            explain = function()
                return "短链接"
            end
        },
        {--日程提醒
            check = function()
                return msg:find("提醒我")
            end,
            run = function()
                local schedule = require("app.common.schedule")
                sendMessage(schedule(group,qq,msg))
                return true
            end,
            explain = function()
                return "提醒我"
            end
        },
        {--百度百科
            check = function()
                return ((msg:find("是") or msg:find("为")) and msg:find("什么")) or (msg:find("谁") and msg:find("是"))
            end,
            run = function()
                local key = msg:gsub("什么",""):gsub("谁",""):gsub("是",""):gsub("为",""):gsub("意思",""):gsub("？",""):gsub("?","")
                if key == "" then
                    sendMessage("有什么本喵可以帮你的嘛")
                    return true
                end
                local answal = apiHttpGet("https://baike.baidu.com/item/"..key:encodeURI()):match("<meta name=\"description\" content=\"(.-)\">")
                if answal ~= nil and answal~="" then
                    sendMessage(answal)
                    return true
                end
                sendMessage("这个问题本喵也帮不了你呀")
                return true
            end,
            explain = function()
                return "百度百科"
            end
        },
        {--QQ个性名生成
            check = function()
                return msg:find("个性网名")==1
            end,
            run = function()
                local keys = msg:gsub("个性网名",""):trim()
                if keys == "" then
                    sendMessage("个性网名+内容")
                    return true
                end
                local key = keys:encodeURI()
                local namehtml = apiHttpPost("http://www.qfans.net/wangming/a","action=submit&qq="..key.."&ytz="..key):match("yigea\">(.-)</ul>")
                local names = ""
                local i = 0
                local j = 0
                for name in namehtml:gmatch(">(.-)</li>") do
                    if i > 0 then
                        if j > 3 then
                            names = names ..name
                            break
                        end
                        names = names ..name.."\n"
                        i = 0
                        j = j+1
                    end
                    if math.random(1,2)~=1 then
                        names = names ..name:gsub("\r","").."            "
                        i = i + 1
                    end
                end
                sendMessage(names)
                return true
            end,
            explain = function()
                return "个性网名"
            end
        },
        {--今日新番
            check = function()
                return msg:find("今日新番") 
            end,
            run = function()
                local global = apiHttpGet("https://bangumi.bilibili.com/web_api/timeline_global"):match("\"is_today\":1,\"seasons\":(.-)]").."]"
                local list = jsonDecode(global)
                local message = ""
                for i=1,#list do
                    title = list[i]['title']
                    if title:find("僅限") == nil then
                        url = list[i]['url']
                        pub_index =list[i]['pub_index']
                        message = message..title.."  "..pub_index.."\n"..url.."\n"
                    end
                end
                sendMessage(message)
                return true
            end,
            explain = function()
                return "今日新番"
            end
        },
        {--代码沙盒
            check = function()
                return msg:find("#")==1
            end,
            run = function()
                sendMessage(cqCqCode_Trope(apiSandBox(cqCqCode_UnTrope(msg:sub(2)))))
                return true
            end,
            explain = function()
                return "代码沙盒"
            end
        },
        {--@触发
        check = function()
            return msg:find("%[CQ:at,qq=" .. cqGetLoginQQ() .. "%]") and msg:gsub("%[CQ:.-%]", ""):len() > 2
        end,
        run = function()
            sendMessage("我被猪@了")
            return true
        end,
    },  
    }

    -- 执行功能 获取菜单
    if bl then
        for i = 1, #app do
            if app[i].check and app[i].check() then
                return app[i].run()
            end
        end
    else
        local m = ""
        local flag = true
        for i = 1, #app do
            local appExplain = app[i].explain and app[i].explain()
            if appExplain then
                m = m ..appExplain
                if flag then
                    m = m .. "    "
                    flag = nil
                else
                    m = m .. "\n"
                    flag = true
                end
            end
        end
        sendMessage(m)
        return true
    end
end
